// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
/**
 * 基础菜单
 */
// 商品管理
import Goods from '@/views/goods/Goods';
// 类目管理
import Category from '@/views/goods/Category';
/**
 * 订单管理
 */
// 未支付订单
import NoPay from '@/views/order/NoPay';
// 已支付订单
import Pay from '@/views/order/Pay';
// 申请退款订单
import ApplyRefundPay from '@/views/order/ApplyRefundPay';
// 售后服务订单
import SaleOrder from '@/views/order/SaleOrder';
// 售后服务订单
import FindOrder from '@/views/order/FindOrder';

import Order from '@/views/pay/Order';

/**
 * 系统管理
 */
// 用户管理
import User from '@/views/system/User';
// 电话配置管理
import PhoneConfig from '@/views/system/PhoneConfig';
// 地址配置管理
import AddressConfig from '@/views/system/AddressConfig';
// 微信联系方式配置管理
import WechatPicConfig from '@/views/system/WechatPicConfig';
// 轮播图配置管理
import SwiperPicConfig from '@/views/system/SwiperPicConfig';
// 日志查看
import Log from '@/views/system/Log';

/**
 * 数据监控
 */
// 监控查询
import druidLogin from '@/views/druid/login';

// 图表界面
import indexTable from '@/views/index/Index';

// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/index/Index',
            name: '后台首页',
            component: indexTable,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/pay/Order',
            name: '交易订单',
            component: Order,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/User',
            name: '用户管理',
            component: User,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/PhoneConfig',
            name: '电话配置管理',
            component: PhoneConfig,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/AddressConfig',
            name: '地址配置管理',
            component: AddressConfig,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/WechatPicConfig',
            name: '微信联系配置管理',
            component: WechatPicConfig,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/SwiperPicConfig',
            name: '轮播图配置管理',
            component: SwiperPicConfig,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/log',
            name: '日志查看',
            component: Log,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/druid/login',
            name: '监控查询',
            component: druidLogin,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/index/Index',
            name: '数据可视化',
            component: indexTable,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/goods/Goods',
            name: '商品详情',
            component: Goods,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/category/Category',
            name: '类目详情',
            component: Category,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/order/NoPay',
            name: '未支付订单',
            component: NoPay,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/order/Pay',
            name: '已支付订单',
            component: Pay,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/order/ApplyRefundPay',
            name: '申请退款订单',
            component: ApplyRefundPay,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/order/SaleOrder',
            name: '售后订单',
            component: SaleOrder,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/order/FindOrder',
            name: '订单查询',
            component: FindOrder,
            meta: {
                requireAuth: true
            }
        }

        ]
    }]
})